# put output to build dir

set(CMAKE_CXX_STANDARD 11)
if (NOT (WIN32 OR MSVC))
    if(CMAKE_BUILD_TYPE MATCHES "Release")
        set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}  -fomit-frame-pointer -fstrict-aliasing -ffunction-sections -fdata-sections -ffast-math -fno-rtti -fno-exceptions")
        add_definitions(-fvisibility=hidden)
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden")
    endif()
endif()
file(GLOB_RECURSE Files "*.cpp" "*.hpp")
if(MNN_BUILD_SHARED_LIBS)
    add_library(MNN_Express SHARED ${Files})
    if (WIN32)
        install(TARGETS MNN_Express RUNTIME DESTINATION lib)
        target_compile_definitions(MNN_Express PRIVATE "-DBUILDING_MNN_EXPRESS_DLL")
        target_compile_definitions(MNN_Express INTERFACE "-DUSING_MNN_EXPRESS_DLL")
    else()
        install(TARGETS MNN_Express LIBRARY DESTINATION lib)
    endif()
else()
    add_library(MNN_Express STATIC ${Files})
    install(TARGETS MNN_Express ARCHIVE DESTINATION lib)
endif()
target_include_directories(MNN_Express PUBLIC "include" "../")

target_link_libraries(MNN_Express ${MNN_DEPEND})
